package com.itlong.cloud.operate.resource;

import com.itlong.cloud.POJO.DTO.operate.WwOperateAppInfoDTO;
import com.itlong.cloud.POJO.DTO.operate.WwOperateSelectAppDTO;
import com.itlong.cloud.POJO.DTO.operate.WwOperateStatusDTO;
import com.itlong.cloud.POJO.PO.WwAppPO;
import com.itlong.cloud.POJO.VO.operate.WwOperateAppInfoVO;
import com.itlong.cloud.operate.service.IOperateAppService;
import com.itlong.cloud.utils.data.handler.SqlUtil;
import com.itlong.cloud.utils.page.Page;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

/**
 * <desc>
 * :
 * <desc>
 *
 * @author LiChangXu
 * @create Date 2021-08-19
 **/
@RestController
public class OperateAppServiceResource {

    @Autowired
    private IOperateAppService iOperateAppService;

    /**
     * <desc>
     *      :测试获取应用列表
     * <desc>
     * @param
     * @return: java.util.List<com.itlong.cloud.POJO.PO.WwAppPO>
     * @date: 2021-08-19 9:16
     **/
    @RequestMapping("/getAppList")
    public List<WwAppPO> getList(){
        return iOperateAppService.getList();
    }

    @RequestMapping("getAppPageList")
    public Page<WwOperateAppInfoVO> getAppPageList(WwOperateSelectAppDTO wwOperateSelectAppDTO)throws Exception{
         return iOperateAppService.getAppInfoPageList(wwOperateSelectAppDTO);
    }

    @RequestMapping("/saveApp")
    public Integer saveApp(WwOperateAppInfoDTO wwOperateAppInfoDTO) throws Exception{
        return iOperateAppService.saveApp(wwOperateAppInfoDTO);
    }

    @RequestMapping("/updateApp")
    public Integer updateApp(WwOperateAppInfoDTO wwOperateAppInfoDTO) throws Exception{
        return iOperateAppService.updateApp(wwOperateAppInfoDTO);
    }

    @RequestMapping("/updateAppStatus")
    public Integer UpdateAppStatus(WwOperateStatusDTO wwOperateStatusDTO) throws Exception{
        return iOperateAppService.updateStatus(wwOperateStatusDTO);
    }
}
